<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/page/share/taglib.jsp"%>
<%
	String root = request.getContextPath();
	response.setHeader("Cache-Control", "no-store"); //HTTP1.1
	response.setHeader("Pragma", "no-cache"); //HTTP1.0
	response.setDateHeader("Expires", 0);
%>
<div id="data" >
	  <h2 class="u-title"> 批次执行日志详情表：</h2>
	  <table class="datashow" style="width: 95%; table-layout: fixed;">
		 <thead>
			<tr >
				<th width="5%" class="table_head">批次号</th>
				<th width="5%" class="table_head">任务号</th>
				<th width="5%" class="table_head">步骤号</th>
				<th width="10%" class="table_head">批量日期</th>
				<th width="10%" class="table_head">批次开始时间</th>
				<th width="10%" class="table_head">批次结束时间</th>
				<!--  <th width="8%" class="txtCenter">上下文</th>  -->
				<!--  <th width="8%" class="txtCenter">情况描述</th>  -->
				<!--  <th width="8%" class="txtCenter">控制规则</th>  -->
				<th width="10%" class="table_head">执行状态</th>
				<!-- <th width="10%" class="txtCenter">错误信息</th>-->
				<th width="10%" class="table_head">批次操作</th>
			</tr>
		</thead>
		<tbody>
		<s:if test="detailList.size > 0">
		 <s:iterator value="detailList" var="logDetail" status="status">
						<s:if test="#status.odd">
						   <tr class="style1">
				            <td><s:property value="#logDetail.batchNo" /></td>
							<td><s:property value="#logDetail.jobNo" /></td>
							<td><s:property value="#logDetail.stepNo" /></td>
							<td><s:property value="#logDetail.batchDate" /></td>
							<td><s:property value="#logDetail.startTime" /></td>
							<td><s:property value="#logDetail.endTime" /></td>
							<!-- <td><s:property value="#logDetail.params" /></td> -->
							<!-- <td><s:property value="#logDetail.desc"  /></td> -->
							<!-- <td><s:property value="#logDetail.runCtrlFlgs" /></td> -->
							
						    <!-- 通过执行状态，给予可操作的功能 -->
							<s:if test= '#logDetail.status.toString() == "COMPLETED"' >
							  <td ><span class="run-success">成功</span></td>
							 <!-- <td><s:property value="#logDetail.errMsg" /></td>-->
							  <td ><span class="run-success">完成</span></td>
							</s:if> 
                            <s:elseif test= '#logDetail.status.toString() == "STARTED"'>
                              <td><span class="run-wait">准备开始</span></td>
                              <!-- <td><s:property value="#logDetail.errMsg" /></td>-->
                              <td><span class="run-wait">等待...</span></td>
                            </s:elseif> 
                            <s:else >
                              <td><span class="run-failed">失败</span> </td>
                            <!-- <td><s:property value="#logDetail.errMsg" /></td>-->
 							  <td>
							      <s:iterator value="#logDetail.operateButtons" var="pm">
								    <a id="close"
									   href="<%=request.getContextPath()%>/exception/shown!handleException.do"
									   class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
									   onclick="runDelog('<s:property value="#logDetail.batchLogId"/>', '<s:property value="#logDetail.id"/>', '<s:property value="#pm.value" />'); return false"> 
									   <span class="ui-button-text"><s:property value="#pm.key" escape="false" /></span>
									</a></br>
								  </s:iterator> 
							  </td>                                                                                
                            </s:else>
						</tr>
						</s:if>
						<s:else>
						   <tr class="style2">
				            <td><s:property value="#logDetail.batchNo" /></td>
							<td><s:property value="#logDetail.jobNo" /></td>
							<td><s:property value="#logDetail.stepNo" /></td>
							<td><s:property value="#logDetail.batchDate" /></td>
							<td><s:property value="#logDetail.startTime" /></td>
							<td><s:property value="#logDetail.endTime" /></td>
							<!-- <td><s:property value="#logDetail.errMsg" /></td> -->
							<!-- <td><s:property value="#logDetail.params" /></td> -->
							<!-- <td><s:property value="#logDetail.desc" /></td> -->
							<!-- <td><s:property value="#logDetail.runCtrlFlgs" /></td> -->
							
						    <!-- 通过执行状态，给予可操作的功能 -->
							<s:if test= '#logDetail.status.toString() == "COMPLETED"' >
							  <td ><span class="run-success">成功</span></td>
							<!-- <td><s:property value="#logDetail.errMsg" /></td>-->
							  <td ><span class="run-success">完成</span></td>
							</s:if> 
                            <s:elseif test= '#logDetail.status.toString() == "STARTED"'>
                              <td><span class="run-wait">准备开始</span></td>
                           <!-- <td><s:property value="#logDetail.errMsg" /></td>-->
                              <td><span class="run-wait">等待...</span></td>
                            </s:elseif> 
                            <s:else >
                              <td><span class="run-failed">失败</span> </td>
                              <!-- <td><s:property value="#logDetail.errMsg" /></td>-->
 							  <td>
							      <s:iterator value="#logDetail.operateButtons" var="pm">
								    <a id="close"
									   href="#"
									   class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
									   onclick="runDelog('<s:property value="#logDetail.batchLogId"/>', '<s:property value="#logDetail.id"/>','<s:property value="#pm.value" />'); return false"> 
									   <span class="ui-button-text"><s:property value="#pm.key" escape="false" /></span>
									</a>
								  </s:iterator> 
							  </td>                                                                                
                            </s:else>
						   </tr>
					    </s:else>
				</s:iterator>
			</s:if>
			<s:else>
				<tr >
					<td colspan="0">
						<span style="color: blue">暂无记录！</span>
					</td>
				</tr>
			</s:else>
		</tbody>
	</table>
   
 <div id="reRunDiv"></div>
</div>

   <script type="text/javascript">
   
	function runDelog(logIdVal,detailLogIdVal,reRunModeVal) {
	var _ctx = "<%=root%>";
		var url = _ctx + "/exception/shown!handleException.do";
		$("#reRunDiv").load(url, {
			logID : logIdVal,
			detailID : detailLogIdVal,
			handleMode:reRunModeVal 
		}, function() {
			alert("执行完毕");
		});
	}
     
   
   </script>


